<?php

class Form_User extends Zend_Form
{
    public function __construct($options = null)
    {
        parent::__construct($options);
        $this->setName('user');

        $id = new Zend_Form_Element_Hidden('id');

        $username = new Zend_Form_Element_Text('username');
        $username->setLabel('user_username')
        ->setRequired(true)
        ->addFilter('StripTags')
        ->addFilter('StringTrim')
        ->addValidator('NotEmpty');      
        
        $password = new Zend_Form_Element_Text('password');
        $password->setLabel('user_password')
        ->setRequired(true)
        ->addFilter('StripTags')
        ->addFilter('StringTrim')
        ->addValidator('NotEmpty');
        
        $role =$this->createElement('select','role'); 
        $role->setLabel('user_role')
        ->setAttrib('class','select')
                ->addMultiOptions(array('0'=>'user_admin','1'=>'user_user'))
                ->setRequired(false);
      
        
        

        $submit = new Zend_Form_Element_Submit('submit');
        $submit->setAttrib('id', 'submitbutton');

        $this->addElements(array($id, $username, $password, $role,$submit));
    }
}